

package cn.shengchao.examstar.me.collect.acl.ports.message;

import cn.shengchao.examstar.product.domain.entity.CourseKnowledgeNode;
import cn.shengchao.examstar.product.domain.entity.Teacher;
import cn.shengchao.examstar.product.ohs.local.message.CourseListDto;
import lombok.Data;
import lombok.Setter;

import java.util.List;

@Data
public class CourseDto {
    private Long id;
    //名称
    private String name;
    //图片
    private String imgUrl;
    //购买人数
    private Integer payNum;
    //课程知识点数量
    private Long knowledgeNodeNum;
    //课程评分
    private Double score;
    //描述
    private String description;
    //教师描述
    @Setter
    private List<Teacher> teacher;

    private List<CourseKnowledgeNode> KnowledgeNodes;

    public static CourseDto of(CourseListDto courseListDto) {
        CourseDto courseDto = new CourseDto();
        courseDto.setId(courseListDto.getId());
        courseDto.setName(courseListDto.getName());
        courseDto.setImgUrl(courseListDto.getImgUrl());
        courseDto.setKnowledgeNodeNum(courseListDto.getKnowledgeNodeNum());
        courseDto.setScore(courseListDto.getScore());
        courseDto.setDescription(courseListDto.getDescription());
        courseDto.setTeacher(courseListDto.getTeacher());
        courseDto.setKnowledgeNodes(courseListDto.getKnowledgeNodes());
        return courseDto;
    }
}
